home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 4
/
Apprentice-Release4.iso
/
Source Code
/
Libraries
/
Graphic Elements 3
/
GEMisc
/
NullGE.c
< prev
next >
Wrap
Text File
|
1994-03-25
|
1KB
|
48 lines
/*
NullGE.c
A "non-existent" Graphic Element.
Two suggested uses:
1) Can be used as an invisible "roll-over", with a CollisionProc
which, for example, does something to the colliding element or
reports to the application program.
2) Can be slaved to a visible Graphic Element and assigned a
CollisionProc, for example to create a collision rectangle
which is different in size or location from that element's
animationRect.
Copyright 1994 by Al Evans. All rights reserved.
3/25/94
*/
#include "NullGE.h"
pascal void RenderNullElement(GrafElPtr element, GWorldPtr destGWorld)
{
#pragma unused(destGWorld, element)
//For debugging, could do
//FrameRect(&element->animationRect);
}
GrafElPtr NewNullElement(GEWorldPtr world, OSType id, short plane, Rect *animRect)
{
GrafElPtr element;
element = NewGrafElement(world, id, plane, sizeof(GrafElement), NoLoader, 0, 0);
if (element) {
element->animationRect = *animRect;
element->copyMode = 0;
element->flags = geShown;
element->renderIt = RenderNullElement;
element->drawIt = nil;
element->drawData = nil;
element->changeIntrvl = 0;
}
return element;
}